package com.design;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;

import com.request.RouterRequest;
import com.request.ServerReceive;



public class ServerForm implements ActionListener
{
	JFrame mainform;
	JPanel top,middle,bottom,bottom1;
	JPanel mainpanel,payment,accounts,smsbanking,estatement;
	JButton bpayment,baccounts,bsmsbanking,bestatement;
	Layers layers=new Layers();
	JMenuBar mb;
	JButton jclose;
	JMenu reg,pay,acc,sms,est;
	JMenuItem pay1,pay2,pay3,acc1,acc2,acc3,sms1;
	JPanel temp=new JPanel();
	public ServerForm() 
	{
		ServerReceive serverReceive=new ServerReceive();
		mainform=new JFrame();
		
		
		mainform.setTitle("Server");
		Dimension di=mainform.getToolkit().getScreenSize();
		int width=di.width;
		int height=di.height;
		int wi=(width-1000)/2;
		int he=(height-600)/2;
		
		mainpanel=new JPanel();
		mainpanel.setLayout(null);
		
		

		top=new JPanel();
		top.setLayout(new FlowLayout());
		top.setBackground(new Color(171,12,87));
		top.setBounds(0,0,1000,100);
		
		JLabel tit=new JLabel("Server Form");
		tit.setForeground(Color.yellow);
		tit.setFont(new Font("verdana",Font.BOLD,15));
		top.add(tit);
		
		mainpanel.add(top);
		middle=new JPanel();
		middle.setLayout(new BorderLayout());
		middle.setBackground(new Color(171,12,87));
		middle.setBounds(0,100,1000,30);
		
		
		/*************************************/

		
	
		/*************************************/
		mainpanel.add(middle);
		
		bottom=new JPanel();
		bottom.setLayout(null);
		//bottom.setBackground(new Color(0,0,0));
		bottom.setBounds(0,130,1000,450);
		mainpanel.add(bottom);
		
		
		bottom1=new JPanel();
		bottom1.setLayout(null);
		jclose=new JButton("close");
		jclose.setBounds(450, 20, 100, 20);
		jclose.addActionListener(this);
		bottom1.add(jclose);
		//bottom1.setLayout(new BorderLayout());
		bottom1.setBackground(new Color(171,12,87));
		//bottom1.setBackground(new Color(0,0,0));
		//bottom1.setBounds(0,580,800,450);
		bottom1.setLayout(new BorderLayout());
		bottom1.setBackground(new Color(171,12,87));
		bottom1.setBounds(0,580,1000,450);
		mainpanel.add(bottom1);
		Layers layers=new Layers();
		bottom=layers.ServerDesign(bottom);
		//payment=layers.CreditPayments();
		/*accounts=new JPanel();
		smsbanking=layers.SmsBanking();
		estatement=new JPanel();*/
		mainpanel.add(bottom);
		
		
		
		mainform.add(mainpanel);
		mainform.setLocation(wi,he);
//		mainform.setUndecorated(true);
		mainform.setSize(1000,630);
		mainform.setVisible(true);
		temp=bottom;
		
	}
	
	
 public static void main(String args[])
 {
	 new ServerForm();
 }


public void actionPerformed(ActionEvent arg0) {
	// TODO Auto-generated method stub
	if(arg0.getSource()==jclose)
	{
		mainform.setVisible(false);
	}
}
}